{extend name="common/base" /}
<!--title-->
{block name="titlekeyword"}
<title>{$content}</title>

{/block}
<!--代码主要内容-->
{block name="main"}
<h6>内容</h6>
<input type="button" onclick="test1()" value="动态创建button 按钮" />
<div id="div1" style="width:200px;height:400px;border:1px solid red;">div1</div>
<h6>代码</h6>
<pre>
		页面

		&lt;input type="button" onclick="test1()" value="动态创建button 按钮" /&gt;
		&lt;div id="div1" style="width:200px;height:400px;border:1px solid red;"&gt;div1&lt;/div&gt;
		
		js
		
		&lt;script language="javascript"&gt;
		function test1(){
			var myElement=document.createElement("input");
			myElement.type="button";
			myElement.value="我是button";
			document.getElementById("div1").appendChild(myElement);
				}
		&lt;/script&gt; 

	 </pre> {/block}
<!--底部js 在这里是js的实际代码区-->
{block name="footjs"}
<script language="javascript">
function test1(){
	var myElement=document.createElement("input");
	myElement.type="button";
	myElement.value="我是button";
	document.getElementById("div1").appendChild(myElement);
		}
</script> {/block}